import axios from '@/axios'
import { queryParams } from '@/composables/util'
// 获取商品列表
export const getOrderListAPI = (page, query = {}) => {
  let r = queryParams(query)
  return axios.get(`/admin/order/${page}${r}`)
}

// 批量删除商品
export const deleteOrderAPI = (ids) => {
  return axios.post(`/admin/order/delete_all`, {
    ids,
  })
}
export const exportOrderListAPI = (query = {}) => {
  let r = queryParams(query)
  // /admin/order/excelexport?tab=all

  return axios.post(
    `/admin/order/excelexport${r}`,
    {},
    {
      responseType: 'blob',
    },
  )
}
export const getShipInfoAPI = (id) => {
  return axios.get(`/admin/order/${id}/get_ship_info`)
}

export const refundOrderAPI = (id, data) => {
  return axios.post(`/admin/order/${id}/handle_refund`, data)
}
